Field of the Invention
The present invention relates to a communication apparatus, a control method therefor, and a storage medium.
Description of the Related Art
In recent years, cases each using an electronic device such as a digital camera incorporating a wireless LAN client function by connecting it to another device are increasing. For example, Japanese Patent Laid-Open No. 2011-35768 discloses a method of facilitating sharing images with another digital camera by incorporating a wireless LAN function in a digital camera. Furthermore, to directly connect devices with each other, electronic devices often incorporate a wireless LAN access point function. When an electronic device incorporates a wireless LAN access point function, it also incorporates a DHCP server function in many cases in order to facilitate assigning IP addresses.
Among devices connected with each other via a wireless LAN, a device which requires a desired service searches for another device having a desired service function upon completion of addressing by the DHCP server function. Note that a digital camera or printer corresponds to a service providing device having a shooting service function or print service function. Such service search is performed using a service search protocol such as mDNS (Multicast DNS) or SSDP (Simple Service Discovery Protocol). The layers of communication protocols such as service search protocols are different from each other in a so-called OSI reference model. Therefore, the wireless LAN client function and wireless LAN access point function generally operate the same protocol.
As described above, a service providing device such as a printer or digital camera conventionally has a wireless LAN client function, and a device having a wireless LAN access point function need only use a service search protocol. That is, the device having the wireless LAN access point function need only simply transfer a service search signal. Since, however, the service providing device such as a printer or digital camera incorporates the wireless LAN access point function, the transfer function of the service search protocol operates, as shown in FIG. 4.
FIG. 4 is a sequence chart showing an operation sequence when digital camera A operating as a client performs a service search. Referring to FIG. 4, digital camera A, digital camera B, printer A, and printer B incorporate a wireless LAN client function and a wireless LAN access point function, and exist on the same network. In this example, digital camera A, digital camera B, and printer B operate as clients, and printer A operates as an access point. When digital camera A multicasts a service search request signal, printer A transfers the received service search request signal to other apparatuses on the same network. In the example of FIG. 4, printer A operating as an access point transfers the received service search request signal to printer B and digital camera B both of which are controlled apparatuses connected to printer A and operate as clients. As a result, digital camera A receives a search response from each of printer A, printer B, and digital camera B. Even though the user of digital camera A intends to connect to printer A whose wireless LAN access point function is operating, it also becomes possible to connect to unnecessary digital camera B and printer B, thereby confusing the user.